package com.example.demo.controller;

import com.example.demo.entity.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author :蕉绿
 * @Date : 2023/2/24 23:27
 * @Version : V1.0
 * @Description :
 */
@RestController
@RequestMapping("/us")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/u")
    User getUserById(Integer id) {
        if(id == null) return null;
        return userService.getUserById(id);
    }
}
